package com.thermofisher.dsc.amanda.model.response;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.List;

/**
 * Created by wenjie.yang on 10/29/2018.
 */
public class PageResponse extends DataListResponse {

    private Integer page;
    private Integer length;
    private Long total;
    private String totalAmount;

    public PageResponse(Integer page, Integer length, Long total,String totalAmount, List data){
        this.length = length;
        this.total = total;
        this.page = page;
        this.setData(data);
        this.totalAmount = totalAmount;
    }

    public PageResponse(Integer page, Long total, List data){
        super();
        this.total = total;
        this.page = page;
        this.setData(data);
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public String getTotalAmount() {
        return this.totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        DecimalFormat decimalFormat = new DecimalFormat("###,###.00");
        this.totalAmount = decimalFormat.format(totalAmount);
    }
}
